using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Bird : MonoBehaviour
{
    public Transform chipsNode;

    private Animator m_animator;

    private void Awake()
    {
        m_animator = GetComponent<Animator>();
    }

    public void FlyTo(Player player)
    {
        var curPos = transform.position;
        curPos.x = player.Pos.x;
        transform.position = curPos;
        player.body.parent = chipsNode;
        m_animator.SetTrigger("Fly");
    }

    public void FlyAway()
    {
        GameManager.Instance.GameOver();
    }
}
